﻿using WMS.FC.Domain.DataTransferObject.Cell;
using WMS.FC.Domain.DomainObject.System;
using WMS.FC.Domain.Service.Cell.Interface;

namespace WMS.FC.Domain.Service.Cell
{
    public class UnbindCellService : IUnbindCellService
    {
        public async Task<ActionResultBase> UnbindCell(string? trayBarcode, List<CellDTO>? cellList, UserInfo userInfo)
        {
            var result = new ActionResultBase("解绑电池");
            try
            {
                if (string.IsNullOrWhiteSpace(trayBarcode))
                    return result.ArgumentError("托盘条码不能为空");

                if (cellList == null || cellList.Count == 0)
                    return result.ArgumentError("电池信息不能为空");

            }
            catch (Exception ex)
            {
                return result.Exception(ex);
            }

            return result;
        }
    }
}
